package cn.iocoder.yudao.framework.web.config;

import cn.iocoder.yudao.framework.common.util.spring.SpringContextUtils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * 项目启动的时候加载容器
 */
@Component
public class MyApplicationContext implements ApplicationContextAware {
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        //将spring上下文设置到SpringContextUtils工具类中
        SpringContextUtils.setApplicationContext(applicationContext);
    }
}
